package april.test_4_8;

import java.util.Scanner;

public class TestMain3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        while (b != 0) {
            int m = a ^ b;
            int n = a & b;
            n <<= 1;
            a = m;
            b = n;
        }
        System.out.println(a);
    }
}
